import random
# from collections import Counter 2

# random_numbers = []
# for i in range(100):
#     random_number = random.randint(0,9)
#     random_numbers.append(random_number)
random_numbers = [random.randint(0, 9) for i in range(100)]
averge = sum(random_numbers) / len(random_numbers)
# counts = Counter(random_numbers)2
# number_counts = Counter(random_numbers).most_common()
print("随机整数列表",random_numbers)
print("平均值为：", averge)
for x in range(10):
    print("{}的个数为{}".format(x,random_numbers.count(x)))
# print("数字出现次数：") 2
# for number in range(10): 2
#     count = counts[number] 2
#     print(number,":",count) 2
# for number, count in number_counts:
#     print(number, "出现了", count, "次")
